function flag = isnet()
% This function returns a 1 if basic internet connectivity
% is present and returns a zero if no internet connectivity
% is detected.

% define the URL
url =java.net.URL('http://www.itba.edu.ar');

% read the URL
try
    link = openStream(url);
    parse = java.io.InputStreamReader(link);
    snip = java.io.BufferedReader(parse);
catch
    flag = 0;
    return
end
if ~isempty(snip)
    flag = 1;
else
    flag = 0;
end
return